home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK2.toast / Development Kits (Disc 2) / QuickTime™ VR 2.0 SDK / Documentation + Extras / Updated Interfaces / QuickDraw 3D 1.5 Interfaces / Interfaces / QD3DWinViewer.h < prev   
Encoding:
C/C++ Source or Header  |  1997-05-22  |  13.8 KB  |  435 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                              **
  3.  **     Module:        QD3DWinViewer.h                                             **                        
  4.  **                                                                              **
  5.  **     Purpose:     WinViewer Controller Interface File.                     **            
  6.  **                                                                              **
  7.  **     Copyright (C) 1996 Apple Computer, Inc.  All rights reserved.         **
  8.  **                                                                              **
  9.  *****************************************************************************/
  10.  
  11. #ifndef QD3DWinViewer_h
  12. #define QD3DWinViewer_h
  13.  
  14.  
  15. #include "QD3D.h"
  16. #include "QD3DGroup.h"
  17.  
  18. #if defined(OS_WIN32) && OS_WIN32
  19.  
  20. #include <windows.h>
  21.  
  22. #if defined(_MSC_VER)    /* Microsoft Visual C */
  23.     #if defined(Q3VIEWER_EXPORTING)    /* define when building DLL    */
  24.         #define Q3VIEWER_EXPORT __declspec( dllexport )     
  25.         #define Q3VIEWER_CALL      
  26.     #else
  27.         #define Q3VIEWER_EXPORT __declspec( dllimport )    
  28.         #define Q3VIEWER_CALL __cdecl     
  29.     #endif /* WIN32_EXPORTING */
  30. #else
  31.     #define Q3VIEWER_EXPORT
  32.     #define Q3VIEWER_CALL      
  33. #endif  /*  _MSC_VER  */
  34.  
  35. typedef void *TQ3ViewerObject;
  36.  
  37. enum {
  38.     kQ3ViewerShowBadge             = 1<<0,
  39.     kQ3ViewerActive                = 1<<1,
  40.     kQ3ViewerControllerVisible    = 1<<2,
  41.     
  42.     kQ3ViewerButtonCamera        = 1<<3,
  43.     kQ3ViewerButtonTruck        = 1<<4,
  44.     kQ3ViewerButtonOrbit        = 1<<5,
  45.     kQ3ViewerButtonZoom            = 1<<6,
  46.     kQ3ViewerButtonDolly        = 1<<7,
  47.     kQ3ViewerButtonReset        = 1<<8,
  48.     kQ3ViewerButtonNone            = 1<<9,
  49.     
  50.     kQ3ViewerOutputTextMode        = 1<<10,
  51.  
  52.     kQ3ViewerDraggingInOff        = 1<<11,
  53.  
  54.     kQ3ViewerDefault            = 1<<15
  55. };
  56.  
  57.  
  58. enum {
  59.     kQ3ViewerEmpty    = 0,
  60.     kQ3ViewerHasModel = 1<<0,
  61.     kQ3ViewerHasUndo  = 1<<1
  62. };
  63.  
  64. typedef enum TQ3ViewerCameraView {
  65.     kQ3ViewerCameraRestore,
  66.     kQ3ViewerCameraFit,
  67.     kQ3ViewerCameraFront,
  68.     kQ3ViewerCameraBack,
  69.     kQ3ViewerCameraLeft,
  70.     kQ3ViewerCameraRight,
  71.     kQ3ViewerCameraTop,
  72.     kQ3ViewerCameraBottom
  73. } TQ3ViewerCameraView;
  74.  
  75. /******************************************************************************
  76.  **                                                                             **
  77.  **        WM_NOTIFY structures                                                   **
  78.  **                                                                             **
  79.  *****************************************************************************/
  80.  
  81. typedef struct TQ3ViewerDropFiles {
  82.     NMHDR    nmhdr; 
  83.     HANDLE    hDrop; 
  84. } TQ3ViewerDropFiles;
  85.  
  86. typedef struct TQ3ViewerSetView {
  87.     NMHDR                nmhdr;
  88.     TQ3ViewerCameraView    view;
  89. } TQ3ViewerSetView;
  90.  
  91. typedef struct TQ3ViewerSetViewNumber {
  92.     NMHDR                nmhdr;
  93.     unsigned long        number;
  94. } TQ3ViewerSetViewNumber;
  95.  
  96. typedef struct TQ3ViewerButtonSet {
  97.     NMHDR                nmhdr;
  98.     unsigned long        button;
  99. } TQ3ViewerButtonSet;
  100.  
  101. /******************************************************************************
  102.  **                                                                             **
  103.  **        WM_NOTIFY defines                                                       **
  104.  **                                                                             **
  105.  *****************************************************************************/
  106.  
  107. #define Q3VNM_DROPFILES        0x5000
  108. #define Q3VNM_CANUNDO        0x5001
  109. #define Q3VNM_DRAWCOMPLETE    0x5002
  110. #define Q3VNM_SETVIEW        0x5003
  111. #define Q3VNM_SETVIEWNUMBER    0x5004
  112. #define Q3VNM_BUTTONSET        0x5005
  113. #define Q3VNM_BADGEHIT        0x5006
  114.  
  115. /******************************************************************************
  116.  **                                                                             **
  117.  **        Win32 Window Class Name                                               **
  118.  **        Can be passed as a parameter to CreateWindow or CreateWindowEx       **
  119.  **                                                                             **
  120.  *****************************************************************************/
  121.  
  122. #define kQ3ViewerClassName "QD3DViewerWindow"
  123.  
  124. /******************************************************************************
  125.  **                                                                             **
  126.  **        Win32 Clipboard type                                                  **
  127.  **                                                                               **
  128.  **                                                                             **
  129.  *****************************************************************************/
  130.  
  131. #define kQ3ViewerClipboardFormat "QuickDraw 3D Metafile"
  132.  
  133.  
  134. #ifdef __cplusplus
  135. extern "C" {
  136. #endif    /* __cplusplus */
  137.  
  138. /******************************************************************************
  139.  **                                                                             **
  140.  **        Creation and destruction                                             **
  141.  **        Note that this is not a QuickDraw 3D object                             **
  142.  **                                                                             **
  143.  *****************************************************************************/
  144.  
  145. Q3VIEWER_EXPORT TQ3ViewerObject Q3VIEWER_CALL Q3WinViewerNew (
  146.     HWND window, 
  147.     const RECT *rect, 
  148.     unsigned long flags);
  149.  
  150. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerDispose(
  151.     TQ3ViewerObject    theWinViewer);
  152.  
  153. /******************************************************************************
  154.  **                                                                             **
  155.  **        Functions to attach data to a WinViewer                                 **
  156.  **                                                                             **
  157.  *****************************************************************************/
  158. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerUseFile(
  159.     TQ3ViewerObject    theWinViewer,
  160.     HANDLE                fileHandle);
  161.  
  162. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerUseData(
  163.     TQ3ViewerObject    theWinViewer,
  164.     void                *data,
  165.     unsigned long        size);
  166.  
  167. /******************************************************************************
  168.  **                                                                             **
  169.  **        Functions to write data out from the WinViewer                         **
  170.  **                                                                             **
  171.  *****************************************************************************/
  172.  
  173. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerWriteFile(
  174.     TQ3ViewerObject    theWinViewer,
  175.     HANDLE                fileHandle);
  176.  
  177. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerWriteData(
  178.     TQ3ViewerObject    theWinViewer,
  179.     void                *data,
  180.     unsigned long        dataSize,
  181.     unsigned long        *actualDataSize);
  182.  
  183. /******************************************************************************
  184.  **                                                                             **
  185.  **        Use this function to force the WinViewer to re-draw                     **
  186.  **                                                                             **
  187.  *****************************************************************************/
  188.  
  189. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerDraw(
  190.     TQ3ViewerObject    theWinViewer);
  191.  
  192. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerDrawContent(
  193.     TQ3ViewerObject theViewer);
  194.  
  195. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerDrawControlStrip(
  196.     TQ3ViewerObject theViewer);
  197.  
  198.  
  199. /******************************************************************************
  200.  **                                                                             **
  201.  **        Function used by the WinViewer to filter and handle events             **
  202.  **                                                                             **
  203.  *****************************************************************************/
  204.  
  205. Q3VIEWER_EXPORT BOOL Q3VIEWER_CALL Q3WinViewerMouseDown(
  206.     TQ3ViewerObject    theWinViewer,
  207.     long                x,
  208.     long                y);
  209.  
  210. Q3VIEWER_EXPORT BOOL Q3VIEWER_CALL Q3WinViewerContinueTracking(
  211.     TQ3ViewerObject    theWinViewer,
  212.     long                x,
  213.     long                y);
  214.  
  215. Q3VIEWER_EXPORT BOOL Q3VIEWER_CALL Q3WinViewerMouseUp(
  216.     TQ3ViewerObject    theWinViewer,
  217.     long                x,
  218.     long                y);
  219.  
  220. /******************************************************************************
  221.  **                                                                             **
  222.  **        This function returns a Bitmap of the contents of the                  **
  223.  **        WinViewer's window.  The application should dispose the Bitmap.         **
  224.  **                                                                             **
  225.  *****************************************************************************/
  226.  
  227. Q3VIEWER_EXPORT HBITMAP Q3VIEWER_CALL Q3WinViewerGetBitmap(
  228.     TQ3ViewerObject    theWinViewer);
  229.  
  230. /******************************************************************************
  231.  **                                                                             **
  232.  **        Calls for dealing with Buttons                                         **
  233.  **                                                                             **
  234.  *****************************************************************************/
  235.  
  236. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerGetButtonRect(
  237.     TQ3ViewerObject    theWinViewer,
  238.     unsigned long        button,
  239.     RECT                *rectangle);
  240.  
  241. Q3VIEWER_EXPORT unsigned long Q3VIEWER_CALL Q3WinViewerGetCurrentButton(
  242.     TQ3ViewerObject    theWinViewer);
  243.     
  244. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerSetCurrentButton(
  245.     TQ3ViewerObject    theWinViewer,
  246.     unsigned long        button);
  247.  
  248. /******************************************************************************
  249.  **                                                                             **
  250.  **        Functions to set/get the group to be displayed by the WinViewer.     **
  251.  **                                                                             **
  252.  *****************************************************************************/
  253.  
  254. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerUseGroup(
  255.     TQ3ViewerObject    theWinViewer,
  256.     TQ3GroupObject        group);
  257.     
  258. Q3VIEWER_EXPORT TQ3GroupObject Q3VIEWER_CALL Q3WinViewerGetGroup(
  259.     TQ3ViewerObject    theWinViewer);
  260.  
  261. /******************************************************************************
  262.  **                                                                             **
  263.  **        Functions to set/get the color used to clear the window                 **
  264.  **                                                                             **
  265.  *****************************************************************************/
  266.  
  267. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerSetBackgroundColor(
  268.     TQ3ViewerObject    theWinViewer,
  269.     TQ3ColorARGB        *color);
  270.     
  271. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerGetBackgroundColor(
  272.     TQ3ViewerObject    theWinViewer,
  273.     TQ3ColorARGB        *color);
  274.  
  275. /******************************************************************************
  276.  **                                                                             **
  277.  **        Getting/Setting a WinViewer's View object.  Disposal is needed.         **
  278.  **                                                                             **
  279.  *****************************************************************************/
  280.  
  281. Q3VIEWER_EXPORT TQ3ViewObject Q3VIEWER_CALL Q3WinViewerGetView(
  282.     TQ3ViewerObject    theWinViewer);
  283.  
  284. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerRestoreView(
  285.     TQ3ViewerObject    theWinViewer);
  286.  
  287. /******************************************************************************
  288.  **                                                                             **
  289.  **        Calls for setting/getting WinViewer flags                             **
  290.  **                                                                             **
  291.  *****************************************************************************/
  292.  
  293. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerSetFlags(
  294.     TQ3ViewerObject    theWinViewer,
  295.     unsigned long        flags);
  296.  
  297. Q3VIEWER_EXPORT unsigned long Q3VIEWER_CALL Q3WinViewerGetFlags(
  298.     TQ3ViewerObject    theWinViewer);
  299.  
  300. /******************************************************************************
  301.  **                                                                             **
  302.  **        Calls related to bounds/dimensions.  Bounds is the size of              **
  303.  **        the window.  Dimensions can either be the Rect from the ViewHints     **
  304.  **        or the current dimensions of the window (if you do a Set).             **
  305.  **                                                                             **
  306.  *****************************************************************************/
  307.  
  308. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerSetBounds(
  309.     TQ3ViewerObject    theWinViewer,
  310.     RECT                *bounds);
  311.     
  312. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerGetBounds(
  313.     TQ3ViewerObject    theWinViewer,
  314.     RECT                *bounds);
  315.  
  316. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerSetDimension(
  317.     TQ3ViewerObject    theViewer,
  318.     unsigned long    width,
  319.     unsigned long    height);
  320.  
  321. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerGetDimension(
  322.     TQ3ViewerObject    theWinViewer,
  323.     unsigned long        *width,
  324.     unsigned long        *height);
  325.  
  326. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerGetMinimumDimension(
  327.     TQ3ViewerObject    theViewer,
  328.     unsigned long    *width,
  329.     unsigned long    *height);
  330.  
  331. /******************************************************************************
  332.  **                                                                             **
  333.  **        Window related calls                                                 **
  334.  **                                                                             **
  335.  *****************************************************************************/
  336.  
  337. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerSetWindow(
  338.     TQ3ViewerObject    theWinViewer,
  339.     HWND                aWindow);
  340.     
  341. Q3VIEWER_EXPORT HWND Q3VIEWER_CALL Q3WinViewerGetWindow(
  342.     TQ3ViewerObject    theWinViewer);
  343.  
  344. Q3VIEWER_EXPORT TQ3ViewerObject Q3VIEWER_CALL Q3WinViewerGetViewer(
  345.     HWND                theWindow);
  346.  
  347. Q3VIEWER_EXPORT HWND Q3VIEWER_CALL Q3WinViewerGetControlStrip (
  348.     TQ3ViewerObject theWinViewer);
  349.  
  350.  
  351. /******************************************************************************
  352.  **                                                                             **
  353.  **        Adjust Cursor provided for compatibility with Mac Viewer             **
  354.  **                                                                             **
  355.  *****************************************************************************/
  356.  
  357. Q3VIEWER_EXPORT TQ3Boolean Q3VIEWER_CALL Q3WinViewerAdjustCursor(
  358.     TQ3ViewerObject    theWinViewer,
  359.     long                x,
  360.     long                y);
  361.  
  362. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerCursorChanged(
  363.     TQ3ViewerObject    theViewer);
  364.  
  365. /******************************************************************************
  366.  **                                                                             **
  367.  **        Returns the state of the WinViewer.  See the constant defined at the **
  368.  **        top of this file.                                                     **
  369.  **                                                                             **
  370.  *****************************************************************************/
  371.  
  372. Q3VIEWER_EXPORT unsigned long Q3VIEWER_CALL Q3WinViewerGetState(
  373.     TQ3ViewerObject    theWinViewer);
  374.  
  375. /******************************************************************************
  376.  **                                                                             **
  377.  **        Clipboard utilities                                                     **
  378.  **                                                                             **
  379.  *****************************************************************************/
  380.  
  381. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerClear(
  382.     TQ3ViewerObject    theWinViewer);
  383.     
  384. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerCut(
  385.     TQ3ViewerObject    theWinViewer);
  386.     
  387. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerCopy(
  388.     TQ3ViewerObject    theWinViewer);
  389.     
  390. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerPaste(
  391.     TQ3ViewerObject    theWinViewer);
  392.  
  393. /******************************************************************************
  394.  **                                                                             **
  395.  **        Undo                                                                  **
  396.  **                                                                             **
  397.  *****************************************************************************/
  398.  
  399. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerUndo(
  400.             TQ3ViewerObject    theViewer);
  401.         
  402. Q3VIEWER_EXPORT TQ3Boolean Q3VIEWER_CALL Q3WinViewerGetUndoString(
  403.             TQ3ViewerObject    theViewer, 
  404.             char             *string,
  405.             unsigned long     stringSize,
  406.             unsigned long    *actualSize);
  407.  
  408. /******************************************************************************
  409.  **                                                                             **
  410.  **        New Camera Stuff                                                     **
  411.  **                                                                             **
  412.  *****************************************************************************/
  413.  
  414.  
  415. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerGetCameraCount(
  416.         TQ3ViewerObject    theViewer, 
  417.         unsigned long     *cnt);
  418.  
  419. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerSetCameraNumber(
  420.         TQ3ViewerObject    theViewer, 
  421.         unsigned long     cameraNo);
  422.  
  423. Q3VIEWER_EXPORT TQ3Status Q3VIEWER_CALL Q3WinViewerSetCameraView(
  424.         TQ3ViewerObject        theViewer, 
  425.         TQ3ViewerCameraView viewType);
  426.  
  427. #ifdef __cplusplus
  428. }
  429. #endif    /* __cplusplus */
  430.  
  431. #endif     /* OS_WIN32 */
  432.  
  433. #endif    /* QD3DWinViewer_h */
  434.  
  435.